# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
if __name__ == '__main__':
    arr1 = np.random.randint(0, 10, (3, 4))
    arr2 = np.random.randint(0, 10, (3, 4))
    print arr1
    print arr2
    # 按照列拼接
    print np.concatenate([arr1, arr2])
    # 行拼接
    print np.concatenate([arr1, arr2], axis=1)
    print "----------------------------------------"
    ser_obj1 = pd.Series(np.random.randint(0, 10, 5), index=range(5))
    ser_obj2 = pd.Series(np.random.randint(0, 10, 4), index=range(4))
    ser_obj3 = pd.Series(np.random.randint(0, 10, 3), index=range(3))
    print ser_obj1
    print ser_obj2
    print ser_obj3
    print pd.concat([ser_obj1, ser_obj2, ser_obj3])
    print pd.concat([ser_obj1, ser_obj2, ser_obj3], axis=1, join='inner')
    print "-----------------------------------"
    df_obj1 = pd.DataFrame(np.random.randint(0, 10, (3, 2)), index=['a', 'b', 'c'],
                           columns=['A', 'B'])
    df_obj2 = pd.DataFrame(np.random.randint(0, 10, (2, 2)), index=['a', 'b'],
                           columns=['C', 'D'])
    print df_obj1
    print df_obj2
    print pd.concat([df_obj1, df_obj2])
    print pd.concat([df_obj1, df_obj2], axis=1)